﻿namespace CSharpHomework
{
    /// <summary>
    /// 输出一个N行的等边三角形
    /// </summary>
    internal class equilateralTriangle
    {
        static void Main()
        {//输入行数
            Console.Write("请输入三角形行数：");
            int N = int.Parse(Console.ReadLine());
            //行数
            for (int i = 1; i <= N; i++)
            {//空格
                for (int j = 1; j <= N - i; j++)
                {
                    Console.Write(" ");
                }
                //星
                for (int k = 1; k <= 2 * i - 1; k++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
        }
    }
}
